package com.edushare.common.util;

import com.edushare.common.vo.Courses;
import com.edushare.common.vo.Departments;
import com.edushare.common.vo.Groups;
import com.edushare.common.vo.Universities;
import com.edushare.common.vo.Users;
import com.edushare.common.vo.interfaces.IFileUploadable;

public class EntityUtil {
	
	public static enum ENTITY{
								UNIVERSITY,
								DEPARTMENT,
								COURSE,
								GROUP,
								USER
							};
	
	public static final <T extends IFileUploadable> ENTITY getEntityType(T entity){
		if(entity instanceof Universities)
			return ENTITY.UNIVERSITY;
		else if(entity instanceof Departments)
			return ENTITY.DEPARTMENT;
		else if(entity instanceof Courses)
			return ENTITY.COURSE;
		else if(entity instanceof Users)
			return ENTITY.USER;
		else if(entity instanceof Groups)
			return ENTITY.GROUP;
		
		return null;
	}

}
